<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('查看实验成绩页面')" />
    <th:block th:include="include :: summernote-css"/>
</head>
<body class="gray-bg">
    <div class="container">
        <div style="text-align: center">
            <br><br>
            <h2 th:text="${report.experimentName}"></h2>
            <br>
            <h3>实验提交日期</h3>
            <span th:text="${#dates.format(report.submitDate,'yyyy-HH-dd HH:mm:ss')}"></span>
            <br>
            <br>
            <br>
            <h3>在线实验结果</h3>
            <input th:value="${report.reportText}" type="hidden" id="u3dMessage" />
            <div class="row" >
                <div class="col-md-3"></div>
                <div class="col-md-6" id="u3dScore" style="border: 1px solid gainsboro;  box-shadow: 0px 0px 4px gainsboro; border-radius:20px ;background-color: white;">
                    <table class="table" id="dataTable">

                    </table>
                </div>
                <div class="col-md-3"></div>
            </div>
            <br>
            <h3 hidden="hidden">实验报告</h3>
        </div>
        <!--<input th:value="${report.experimentReport}" type="text" id="report" hidden="hidden"/>
        <div class="col-md-12">
            <div class="summernote">

            </div>
        </div>-->
        <div>
            <br>
            <div class="row">
            <h3 style="text-align: center">教师评语</h3>
            <input th:value="${report.experimentEvaluate}" type="hidden" id="experimentEvaluate"/>
            <div>
                <div class="col-md-3"></div>
                <div class="col-md-6" id="comment" style="border: 1px solid gainsboro;  box-shadow: 0px 0px 4px gainsboro; border-radius:20px ;background-color: white;min-height:50px">
                     <p style="text-align: center;font-size: 20px" id="message" hidden="false">教师尚未给与评论</p>
                </div>
                <div class="col-md-3"></div>
            </div>
            </div>
            <br>
            <br>
            <div class="row" >
                <div class="col-md-3"></div>
            <div class="col-md-2">
                <span style="font-size: 20px">该次分数为:</span>
            </div>
            <div class="col-md-3">
                <input type="text" class="form-control" id="score" th:value="${report.score == 0?'未评分':report.score == null?'未评分':report.score}" disabled/>
            </div>
                <div class="col-md-1">
                    <span>分</span>
                </div>
            </div>
        </div>
        </div>
    </div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: summernote-js" />
</body>
<script>
    $(function(){
        var u3dScore=$("#u3dMessage").val();
        var array=new Array();
        array=u3dScore.split(",");
        for(var i=0;i<array.length;i++){
            $("#dataTable").append("<tr><td>"+array[i]+"</td></tr>");
        }

        $('.summernote').summernote({
            placeholder: '实验报告内容',
            height : 500,
            lang : 'zh-CN',
            followingToolbar: false,
        });
        $(".summernote").summernote('code',$("#report").val());
        $('.summernote').summernote('disable');


    })

    var message= $("#experimentEvaluate").val();
    if(message==null || message=='' || message==undefined){
        $("#message").attr("hidden",false);
        //$("#comment").append($("#experimentEvaluate").val())
    }else{
        $("#message").attr("hidden",true);
        $("#comment").append($("#experimentEvaluate").val())
    }


    $('.summernote1').summernote({
        placeholder: '請輸入教師評語',
        height: 500,
        lang: 'zh-CN',
        followingToolbar: false,
    });
</script>
</html>